package biz.datalk.industrialland.admin.modules.online.dynform.service;

import biz.datalk.industrialland.admin.modules.online.dynform.pojo.dto.DynformFieldDTO;
import biz.datalk.industrialland.admin.modules.online.dynform.pojo.dto.DynformHeadDTO;
import biz.datalk.industrialland.admin.modules.online.dynform.pojo.po.DynformHead;
import biz.datalk.industrialland.common.result.UnifyResult;

import java.util.List;
import java.util.Map;

/**
 * @author tarofang@163.com
 * @date 2019-12-17
 */
public interface IDynformServices {
    UnifyResult list(DynformHeadDTO dynformHeadDTO);

    UnifyResult addHead(DynformHeadDTO dynformHeadDTO);

    UnifyResult editHead(DynformHeadDTO dynformHeadDTO);

    UnifyResult delHead(DynformHeadDTO dynformHeadDTO);

    UnifyResult headDetail(DynformHeadDTO dynformHeadDTO);

    /**
     * 同步到数据
     *
     * 根据Id获取表相关数据，并建表
     *
     * @author       tarofang@163.com
     * @date         2019-12-19
     *
     * @param dynformHeadDTO id
     * @return 指定格式返回值
     */
    UnifyResult doDbSync(DynformHeadDTO dynformHeadDTO);

    DynformHead selectByPk(String tId);

    List<DynformFieldDTO> selectByTableId(String tableId);
    List<DynformFieldDTO> selectByTableId(String tableId, boolean includeFieldDict);

    UnifyResult remove(DynformHeadDTO dynformHeadDTO);

    /**
     * 查询表数据
     *
     * @author       tarofang@163.com
     * @date         2019年12月31日
     *
     * @return 数据库中的表
     */
    UnifyResult queryTables();

    UnifyResult importFromDB(Map<String, String> params);
}
